Skip to content

feat(plugins): Support bootstrap configuration#1079

Open
sanderob wants to merge 2 commits into
netbox-community:mainfrom
eidsivabredband:feat(plugins)-support-bootstrap-configuration
Open

feat(plugins): Support bootstrap configuration#1079
sanderob wants to merge 2 commits into
netbox-community:mainfrom
eidsivabredband:feat(plugins)-support-bootstrap-configuration

Conversation

@sanderob
Copy link
Copy Markdown
Contributor

@sanderob sanderob commented Mar 2, 2026

This PR solves the need for Python configuration that is executed before plugins are imported. The configuration is appended to configuration.py, through the key extraBootstrapConfig. This PR is created in relevance to an existing issue.

Fixes #1043

@LeoColomb
Copy link
Copy Markdown
Member

Thanks for submitting this pull request, @sanderob.
I'm advocating to avoid adding any new values as much as possible.
What about simply moving the config loading after the DATABASE config?

@sanderob
Copy link
Copy Markdown
Contributor Author

sanderob commented Mar 5, 2026

Thanks for submitting this pull request, @sanderob. I'm advocating to avoid adding any new values as much as possible. What about simply moving the config loading after the DATABASE config?

Hi @LeoColomb!

I believe your suggestion to move the configuration loading (_load_yaml()) is due to a plan to include the relevant configuration through the extraConfig functionality of the chart? It seems this is for yaml-files only, as seen here:

extra_config_base = Path("/run/config/extra")
config_files = [Path("/run/config/netbox/netbox.yaml")]

config_files.extend(sorted(extra_config_base.glob("*/*.yaml")))

However, the necessary configuration is native python code, for example the following:

from netbox_branching.utilities import DynamicSchemaDict
DATABASES = DynamicSchemaDict(DATABASES)
DATABASE_ROUTERS = ['netbox_branching.database.BranchAwareRouter']

I am open to solve this without adding any additional keys. Are you aware of any methods for including (and executing) python code as any form of additional config?

@sanderob
Copy link
Copy Markdown
Contributor Author

sanderob commented May 4, 2026

@LeoColomb I am adding a small reminder here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Features for configuring plugins in a bootstrap phase

2 participants